home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 46 / Mobiclic46.iso / pc / DATA / SHARED / COMMUNS.CST / 00004_Script_gestion du son < prev    next >
Text File  |  2002-07-12  |  2KB  |  74 lines

  1. -------------------------------------------------------------------
  2. -------------------------- GESTION DU SON -------------------------
  3. -------------------------------------------------------------------
  4.  
  5. global dernierSon -- nom du dernier son jouΘ
  6. global nivSon -- liste α 3 termes contenant le niveau sonore de chaque piste
  7. global volumeOn -- indique si la fenΩtre de rΘglage du volume est active
  8. global menusActifs -- indique si les menus sont actifs
  9. global ouvreVolume -- 
  10.  
  11. -- lecture d'un son
  12. on joueSon nom, n
  13.   if the paramCount = 1 then
  14.     set n = 3
  15.   end if
  16.   if voidP(nivSon)=1 then
  17.     set nivSon=[255,255,255]
  18.   end if
  19.   -- ajout Θventuel de "sons:"
  20.   if char 1 to 9 of nom <> "sons" then
  21.     if offset(":", nom) = 0 then
  22.       set nom = "sons:" & nom
  23.     end if
  24.   end if
  25.   set dernierSon=nom
  26.   --
  27.   put the pathName & nomDos(nom) & ".aif" into nom
  28.   put "  Son jouΘ : " & dernierSon
  29.   sound playFile n, nom
  30.   -- rΘglage du niveau des autres canaux
  31.   repeat with i=1 to 3
  32.     if i<>n and getAt(nivSon,i)>102 then
  33.       set the volume of sound i to 110
  34.     end if
  35.   end repeat
  36. end joueSon
  37.  
  38. -- rΘglage du volume
  39. on niveauSon
  40.   if voidP(nivson) = 1 then
  41.     set nivson=[255,255,255]
  42.   end if
  43.   repeat with i=1 to 3
  44.     set the volume of sound i to getAt(nivSon,i)
  45.   end repeat
  46. end nivSon
  47.  
  48. -- attendre la fin d'un son
  49. on attendreSon p
  50.   repeat while soundBusy(p)
  51.     updateStage
  52.     temporise(0.1)
  53.   end repeat
  54. end
  55.  
  56. -- dΘsactivation des pistes audio
  57. on coupeSon
  58.   repeat with i=1 to the paramCount
  59.     if value(param(i))<>0 then
  60.       puppetSound (param(i)),0
  61.     else
  62.       listeSons param(i)
  63.     end if
  64.   end repeat
  65. end coupeSon
  66.  
  67. on listeSons chaine
  68.   set n=offset(">", chaine)
  69.   set n1=value(char 1 to n-1 of chaine)
  70.   set n2=value(char n+1 to length(chaine) of chaine)
  71.   repeat with j=n1 to n2
  72.     puppetSound j,0
  73.   end repeat
  74. end listeSons